# time_window.py

from PySide6.QtWidgets import QWidget, QVBoxLayout, QLabel, QPushButton
from PySide6.QtCore import Qt

class TimeWindow(QWidget):
    def __init__(self, controller):
        super().__init__()
        self.controller = controller
        self.setWindowTitle("Time Window")
        self.setGeometry(300, 300, 300, 200)

        self.init_ui()

    def init_ui(self):
        layout = QVBoxLayout()

        self.time_label = QLabel("00:00:00")
        self.time_label.setAlignment(Qt.AlignCenter)
        layout.addWidget(self.time_label)

        self.pause_button = QPushButton("暂停")
        self.pause_button.clicked.connect(self.controller.toggle_time_display)
        layout.addWidget(self.pause_button)

        self.exit_button = QPushButton("退出")
        self.exit_button.clicked.connect(self.close)
        layout.addWidget(self.exit_button)

        self.setLayout(layout)